//
//  RemindView.m
//  NuwaRobot
//
//  Created by Kendama on 2017/12/2.
//  Copyright © 2017年 Kendama. All rights reserved.
//

#import "RemindView.h"

@implementation RemindView

- (UITableView *)tableView
{
    if(!_tableView)
    {
        UIView *superView = self;
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStyleGrouped];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        
        _tableView.estimatedSectionFooterHeight = 0;
        _tableView.estimatedSectionHeaderHeight = 0;
        [superView addSubview:_tableView];
        _tableView.backgroundColor = [UIColor clearColor];
    }
    return _tableView;
}

- (UIButton *)voiceButton
{
    if(!_voiceButton)
    {
        UIView *superView = self;
        _voiceButton = [[UIButton alloc]init];
        [superView addSubview:_voiceButton];
        [_voiceButton setBackgroundImage:imageWithName(@"but_voiceimport") forState:UIControlStateNormal];
    }
    return _voiceButton;
}
- (UILabel *)voiceLabel
{
    if(!_voiceLabel)
    {
        UIView *superView = self;
        _voiceLabel = [[UILabel alloc]init];
        [superView addSubview:_voiceLabel];
        [_voiceLabel setFont:fontCommonSize];
        [_voiceLabel setTextColor:rgba(88,111,161,1)];
        _voiceLabel.text = @"按住添加语音备忘录";
    }
    return _voiceLabel;
}


#pragma mark --- 设置视图布局
- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(superView.mas_top).with.offset(px1920Height(252));
        make.left.mas_equalTo(superView.mas_left).with.offset(px1080Width(40));
        make.right.mas_equalTo(superView.mas_right).with.offset(-px1080Width(40));
        make.bottom.mas_equalTo(superView.mas_bottom);
    }];
    
    
    [self.voiceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(superView.mas_centerX);
        make.bottom.mas_equalTo(superView.mas_bottom).with.offset(-px1920Height(100));
    }];
    
    [self.voiceButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.voiceLabel.mas_top).with.offset(-px1920Height(57));
        make.centerX.mas_equalTo(superView.mas_centerX);
    }];
}

@end
